﻿using System;
using NUnit.Framework;
using OpenQA.Selenium;

namespace mvcForum.Tests.WebUI {

	[TestFixture]
	public class B002_InitialSetupTest {
		private IWebDriver driver;

		#region Initialization and cleanup
		[TestFixtureSetUp]
		public void TestInitialize() {
			driver = TestHelper.GetDriver();
		}

		[TestFixtureTearDown]
		public void TestCleanup() {
			if (driver != null) {
				driver.Close();
			}
		}
		#endregion

		[Test]
		public void Configure() {
			driver.LogOn(Constants.Users.Admin.Email, Constants.Users.Admin.Password);
			driver.VisitURL("forumadmin/settings/userregistration");

			driver.UnselectCheckbox("RequireEmailValidation");

			IWebElement button = driver.FindButton("Update");
			button.Click();
		}
	}
}